
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/support/taglibs.jsp" %>


<stripes:layout-render name="/support/layout/standard.jsp" title="View Collaboration" page="collaborations">
<stripes:layout-component name="contents">
<stripes:errors/>
<jsp:useBean id="isernManager" scope="page"
           class="edu.hawaii.myisern.model.IsernManager"/>
           
<table class="layout"><tr><td class="layoutLeft">
<stripes:form action="/CollaborationForm.action" id="MyForm">

 <table class="leftRightForm">
                <tr>
                    <th>ID:</th>
                    <td>${empty actionBean.id ? "n/a" : actionBean.id}
                        <stripes:hidden name="id"/>
                    </td>
                 </tr>
                 <tr>
                    <th>Name:</th>
                    <td>${actionBean.collaboration.name}
                    </td>                 
                 </tr>
                 <tr>
                    <th>Description:</th>
                    <td>${actionBean.collaboration.description}
                    </td>                 
                 </tr>
                 <tr>
                    <th>Year:</th>
                    <td>
                    <c:forEach var="year" items="${actionBean.collaboration.years.year}" varStatus="loop">
   	      				${year} 
 	    			</c:forEach>
                    </td>            
                 </tr>
                 <tr>
                    <<th>Collaborating<br />Organizations:</th>               
                    <td>
                    <table>
                    <c:forEach items="${actionBean.collaboratingOrganizations}" var="organization" varStatus="loop"> 
          			 <tr><td><stripes:link href="OrganizationForm.action" event="view">
                                ${organization}
                                <stripes:param name="id" value="${organization}"/>
                            </stripes:link></td></tr>
        			</c:forEach>  
                    </table>
                    </td>                            
                 <tr>
                 </tr>                 
                    <th>Outcome Types:</th>     
                    <td>   
                    <table>
                    <c:forEach items="${actionBean.collaboration.outcomeTypes.outcomeType}" var="outcomeTypes" varStatus="loop"> 
          			 <tr><td>${outcomeTypes}</td></tr>
        			</c:forEach>  
                    </table>          
                    </td>                      
                 </tr>              
                    <th>Collaboartion Types:</th>     
                    <td>
                    <table>
                    <c:forEach items="${actionBean.collaboration.collaborationTypes.collaborationType}" var="collaborationType" varStatus="loop"> 
          			 <tr><td>${collaborationType}</td></tr>
        			</c:forEach>  
                    </table>          
                    </td>  
                 </tr>                                             
            </table>
            
            <div class="buttons">
                <stripes:submit name="preEdit" value="Edit"/>
                <stripes:submit name="remove" value="Remove" onclick="return confirm('Are you sure you want to remove Collaboration ${actionBean.collaboration.name}?')"/>
            </div>
           </stripes:form>
           </td>
           <td class="layoutRight">
           <table class="engagedCollaborations">
                	<tr><th>Involed Researchers:</th></tr>
          			 <tr><td>
                     <table>
                    <c:forEach items="${actionBean.collaboratingOrganizationObjects}" var="organization" varStatus="loop"> 
          			 <tr><th align="left">${organization.name}:</th></tr>
                     	<tr><td><stripes:link href="ResearcherForm.action" event="view">
               	                 ${organization.contact}
              	                  <stripes:param name="id" value="${organization.contact}"/>
              	              </stripes:link>
                        </td></tr>
                        <c:forEach items="${organization.affiliatedResearchers.affiliatedResearcher}" var="researcher"> 
          				 <tr><td><stripes:link href="ResearcherForm.action" event="view">
               	                 ${researcher}
              	                  <stripes:param name="id" value="${researcher}"/>
              	              </stripes:link>
              	         </td></tr>
        				</c:forEach>  
        			</c:forEach>  
                    </table>
                     </td></tr>
		        </table>
           </td>
           </tr>
           </table>
    </stripes:layout-component>
</stripes:layout-render>
